#include "metaspace.h"

MemoryChunk* Metaspace::mem_chunk = NULL;

void Metaspace::global_initialize(){
    MemoryPool* mem_pool = new MemoryPool;//应该放一个全局，还需要进行销毁
    mem_chunk =  mem_pool->new_chunk(1024 * 1024 *10); 
    
}

MetaWord* Metaspace::allocate(size_t word_size){

    MemoryCell* cell= mem_chunk->malloc(word_size * BytesPerWord);
    return new MetaWord(cell);
}